const base = {
	'/test': {
		get: {
			summary: '测试接口',
			description: '定义一个简单的路由',
			tags: ['用户信息'],
			parameters: [
				{
					name: 'test',
					in: 'query',
					description: '测试参数',
					required: true,
					schema: {
						type: 'string'
					}
				}
			],
			responses: {
				200: {
					description: '成功',
					content: {
						'application/json': {
							schema: {
								type: 'string'
								// properties: {
								//  code: {
								//   type: "number",
								//   description: "状态码"
								//  },
								//  message: {
								//   type: "string",
								//   description: "状态信息"
								//  },
								//  data: {
								//   type: "object",
								//   description: "数据"
								//  }
								// }
							}
						}
					}
				}
			}
		}
	},
	'/user': {
		get: {
			summary: '测试接口',
			description: '测试接口',
			tags: ['用户信息'],
			parameters: [
				{
					name: 'test',
					in: 'query',
					description: '测试参数',
					required: true,
					schema: {
						type: 'string'
					}
				}
			],
			responses: {
				200: {
					description: '成功',
					content: {
						'application/json': {
							schema: {
								type: 'object',
								properties: {
									code: {
										type: 'number',
										description: '状态码'
									},
									message: {
										type: 'string',
										description: '状态信息'
									},
									data: {
										type: 'object',
										description: '数据'
									}
								}
							}
						}
					}
				}
			}
		}
	},
	'/login': {
		post: {
			summary: '用户登录',
			description: '登录用户账户返回一个 token',
			tags: ['用户信息'],
			requestBody: {
				content: {
					'application/json': {
						schema: {
							type: 'object',
							properties: {
								username: {
									type: 'string',
									required: true,
									description: '用户名'
								},
								password: {
									type: 'string',
									required: true,
									description: '密码'
								}
							}
						}
					}
				}
			},
			responses: {
				200: {
					description: '成功',
					content: {
						'application/json': {
							schema: {
								type: 'object',
								properties: {
									token: {
										type: 'string',
										description: 'token 信息'
									}
								}
							}
						}
					}
				}
			}
		}
	},
	'/loginOut': {
		post: {
			summary: '用户登出',
			description: '用户退出登录返回一个 boolean',
			tags: ['用户信息'],
			responses: {
				200: {
					description: '成功',
					content: {
						'application/json': {
							schema: {
								type: 'boolean',
								enum: [true, false],
								description: 'true-成功或者 false-失败'
							}
						}
					}
				}
			}
		}
	},
	'/register': {
		post: {
			summary: '用户注册',
			description: '',
			tags: ['用户信息'],
			requestBody: {
				content: {
					'application/json': {
						schema: {
							type: 'object',
							properties: {
								username: {
									type: 'string',
									required: true,
									description: '用户名'
								},
								password: {
									type: 'string',
									required: true,
									description: '密码'
								}
							}
						}
					}
				}
			},
			responses: {
				200: {
					description: '成功',
					content: {
						'application/json': {
							schema: {
								type: 'object',
        properties: {
         message: {
          type: 'string',
          description: '状态信息'
         },
        }
							}
						}
					}
				}
			}
		}
	},
	'/userInfo': {
		get: {
			summary: '测试接口',
			description: '测试接口',
			tags: ['用户信息'],
			parameters: [
				{
					name: 'test',
					in: 'query',
					description: '测试参数',
					required: true,
					schema: {
						type: 'string'
					}
				}
			],
			responses: {
				200: {
					description: '成功',
					content: {
						'application/json': {
							schema: {
								type: 'object',
								properties: {
									code: {
										type: 'number',
										description: '状态码'
									},
									message: {
										type: 'string',
										description: '状态信息'
									},
									data: {
										type: 'object',
										description: '数据',
										properties: {
											sex: {
												type: 'string',
												description: '性别'
											}
										}
									}
								}
							}
						}
					}
				}
			}
		}
	}
}

module.exports = base
